package com.example.K501;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

/**
 * This is the splash screen page for the app.
 * @author WaltonWellness
 *
 */
public class SplashActivity extends Activity {

	MediaPlayer ourSong;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		
		
		Thread timer =  new Thread(){
			public void run(){
				try{
					sleep(5000); //how many milliseconds we want this to sleep ~ 5 seconds
				}catch(InterruptedException e){
					//if there is a interrupted exception of some sort, we're going to catch that
					e.printStackTrace(); //for debugging
				}finally{
					Intent openStartingPoint = new Intent("com.example.K501.LOGINACTIVITY");
					
					//start the starting_point activity after it sleeps for 5 seconds
					startActivity(openStartingPoint);
				}
			}
		};
		timer.start();
	}


	/* (non-Javadoc)
	 * @see android.app.Activity#onPause()
	 */
	@Override
	protected void onPause() {

		//when we call the splashactivity activity, we want the splash activity to stop/destroy it self so the user can't hit the back button 
		super.onPause();
		

		finish(); //get rid of the splash activity 
		
	}

	
	
}